/*
 * @Description: 意见征询数据模型
 * @Author: wind-lc
 * @version: 1.0
 * @Date: 2022-10-13 15:33:20
 * @LastEditTime: 2022-11-24 21:12:36
 * @FilePath: \cscec-pms-admin\src\views\matters\approval\components\consultation\model.js
 */
import SelectStaffWithTooltip from '@/components/Select/SelectStaffWithTooltip'
// 意见征询列表表头
const columns = [
  {
    title: '序号',
    width: 80,
    align: 'center',
    customRender: (text, record, index) => {
      return index + 1
    }
  },
  {
    title: '征询人意见',
    dataIndex: 'opinions',
    width: 180,
    scopedSlots: { customRender: 'opinions' }
  },
  {
    title: '被征询人回复',
    dataIndex: 'replyOpinions',
    width: 180,
    scopedSlots: { customRender: 'replyOpinions' }
  },
  {
    title: '征询节点',
    dataIndex: 'taskName',
    width: 200
  },
  {
    title: '征询人',
    dataIndex: 'userName',
    width: 160
  },
  {
    title: '被征询人',
    dataIndex: 'receiveUserName',
    width: 160
  },
  {
    title: '征询发起时间',
    dataIndex: 'createTime',
    width: 200
  },
  {
    title: '征询回复时间',
    dataIndex: 'endTime',
    width: 200
  },
  {
    title: '滞留时间',
    dataIndex: 'claimTime',
    width: 200
  }
]
// 选择审批人列表表头
const columns1 = [
  {
    title: '序号',
    width: 70,
    align: 'center',
    customRender: (text, record, index) => {
      return index + 1
    }
  },
  {
    title: '节点名称',
    dataIndex: 'taskInfo.name',
    width: 240
  },
  {
    title: '审批人',
    dataIndex: 'approver',
    scopedSlots: { customRender: 'subordinateapprover' },
  }
]
// 意见征询表单项
const formOption = [
  {
    label: '征询人意见',
    keyName: 'opinions',
    type: 'BaseTextarea',
    placeholder: '请填写征询建议',
    span: 24,
    rules: [{ required: true, message: '请填写征询建议', trigger: 'change' }]
  },
  {
    label: '征询人',
    keyName: 'receiveUserId',
    type: SelectStaffWithTooltip,
    placeholder: '请选择征询人',
    attrs: {
      mode: 'multiple',
      labelInValue: true,
      // 查询公司用户
      requestParams: {
        types: [0]
      }
    },
    span: 24,
    rules: [{ required: true, message: '请选择征询人', trigger: 'change' }]
  }
]
// 选择转办人列表表头
const columns2 = [
  {
    title: '序号',
    width: 70,
    align: 'center',
    customRender: (text, record, index) => {
      return index + 1
    }
  },
  {
    title: '节点名称',
    dataIndex: 'taskName',
    width: 240
  },
  {
    title: '转办人',
    dataIndex: 'tranfer',
    scopedSlots: { customRender: 'tranfer' },
  }
]
// 选择转办人表单项
const formOption1 = [
  {
    label: '转办意见',
    keyName: 'opinions',
    type: 'BaseTextarea',
    span: 24,
    placeholder: '请填写转办意见',
    rules: [{ required: true, message: '请填写转办意见', trigger: 'change' }]
  }
]
export {
  columns,
  columns1,
  formOption,
  columns2,
  formOption1
}